home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d14 / baswind8.arc / DEMO1.BAS < prev    next >
BASIC Source File  |  1990-09-14  |  15KB  |  468 lines

  1. 'DEMO OF BASWIND7 MODULES AND BWTOOLS
  2. '
  3. '  MODULE : DEMO1.BAS
  4. '
  5. '  BY : James P. Morgan, 5226 Via Hacienda #115 Orlando FL, 32809
  6. '
  7. '                Version 8.0, Sept 1990
  8. '
  9.        CLOSE
  10.        CLEAR
  11. '      SCREEN 0,0,0
  12.        WIDTH 80
  13.        KEY OFF
  14.        COLOR 7,1
  15.        CLS
  16.  
  17.        DEFINT A-Z
  18.  
  19.        OPTION BASE 0
  20.  
  21.        RETURN.CODE%=0
  22.  
  23.        WinArraySize%=6000
  24.  
  25.        DIM WinScreenArray%(WinArraySize%)
  26.  
  27.        WinWaitForVerticalRetrace=0
  28.        WinActiveScreen=0
  29.        WinScreenSegment%=0
  30.        SCREEN.POINTER%=WinActiveScreen
  31.        WinScreenPointer%=0
  32.  
  33. 'PUT UP OPENING SCREEN
  34. '4 WINDOWS OF DIFFERENT COLORS AND A TITLE WINDOW
  35.  
  36.        CALL MAKEWIND(5,15,13,45,4,4,3,0,1,"",RETURN.CODE%)
  37.        SECONDS!=1.0
  38.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  39.        CALL MAKEWIND(4,36,15,75,3,15,2,0,1,"",RETURN.CODE%)
  40.        SECONDS!=1.0
  41.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  42.        CALL MAKEWIND(10,10,21,50,2,0,5,0,1,"",RETURN.CODE%)
  43.        SECONDS!=1.0
  44.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  45.        CALL MAKEWIND(13,42,22,78,1,3,12,0,1,"",RETURN.CODE%)
  46.        SECONDS!=1.0
  47.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  48.  
  49.        CALL MAKEWIND(9,20,14,60,2,0,7,0,1,"",RETURN.CODE%)
  50.  
  51.        COLOR 0,7
  52.        LOCATE 11,35
  53.        PRINT"PRESENTING...";
  54.  
  55.        SECONDS!=5.0
  56.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  57.  
  58.        CALL MAKEWIND(9,20,14,60,0,0,7,0,0,"",RETURN.CODE%)
  59.        CALL MAKEWIND(9,20,14,60,2,0,7,1,0,"",RETURN.CODE%)
  60.  
  61.        LOCATE 10,33:PRINT"B A S W I N D 8"
  62.        LOCATE 12,26:PRINT"   Windowing Routines for the"
  63.        LOCATE 13,26:PRINT"Microsoft QuickBASIC 4 Compiler"
  64.  
  65.        SECONDS!=8.0
  66.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  67.  
  68.        CALL MAKEWIND(13,50,20,75,1,0,6,0,1,"",RETURN.CODE%)
  69.  
  70.        COLOR 0,6
  71.        LOCATE 14,61:PRINT "By"
  72.        LOCATE 15,56:PRINT "James P. Morgan"
  73.        LOCATE 16,52:PRINT "5226 Via Hacienda #115"
  74.        LOCATE 17,55:PRINT "Orlando FL, 32809"
  75.        LOCATE 19,53:PRINT "based on PD works by"
  76.        LOCATE 20,59:PRINT "Dave Evers"
  77.  
  78.        SECONDS!=10.0
  79.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  80.  
  81.        CALL MAKEWIND(8,25,15,55,2,7,1,1,0,"",RETURN.CODE%)
  82.  
  83.        COLOR 15,1
  84.        LOCATE  8,35:PRINT "Including ..."
  85.        LOCATE 10,30:PRINT "*** Window Tools ***"
  86.        LOCATE 12,28:PRINT "A collection of routines"
  87.        LOCATE 13,28:PRINT "for integration into your"
  88.        LOCATE 14,28:PRINT "own programs.
  89.  
  90.        SECONDS!=8.0
  91.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  92.  
  93.        CALL MAKEWIND(8,25,15,55,2,7,1,0,0,"",RETURN.CODE%)
  94.  
  95.        LOCATE 8,25:PRINT  "   * * * * * * * * * * * * * "
  96.        LOCATE 10,28:PRINT "Stand by for a guided tour"
  97.        LOCATE 12,28:PRINT "through the many facets of"
  98.        LOCATE 14,28:PRINT "this exciting program."
  99.  
  100.        SECONDS!=5.0
  101.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  102.  
  103.        CLS
  104.  
  105.        CALL MAKEWIND(9,15,16,65,2,0,7,0,1,"",RETURN.CODE%)
  106.  
  107.        COLOR 0,7
  108.  
  109.        LOCATE 10,18:PRINT "The basic  purpose of BASWIND8 is to provide"
  110.        LOCATE 11,18:PRINT "the  fundamental  routines for  implementing"
  111.        LOCATE 12,18:PRINT "simple 'windowing' into your QuickBASIC pro-"
  112.        LOCATE 13,18:PRINT "grams and providing MS Mouse support also.  "
  113.        LOCATE 14,18:PRINT " With just a few simple statements, you can "
  114.        LOCATE 15,18:PRINT "'pop-up' a colored  window onto the screen.."
  115.  
  116.        SECONDS!=15.0
  117.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  118.  
  119.        CALL MAKEWIND(3,50,8,79,1,15,4,0,0,"",RETURN.CODE%)
  120.  
  121.        SECONDS!=4.0
  122.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  123.  
  124.        CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
  125.  
  126.        LOCATE 12,18:PRINT"The window can be a solid panel of any of
  127.        LOCATE 14,18:PRINT"the BASIC background colors; such as ..."
  128.  
  129.        SECONDS!=4.0
  130.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  131.  
  132.        CALL MAKEWIND(2,3,8,35,0,1,2,0,0,"",RETURN.CODE%)
  133.  
  134.        SECONDS!=4.0
  135.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  136.  
  137.        CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
  138.  
  139.        LOCATE 12,18:PRINT"or it can be surrounded by a 'frame' in any"
  140.        LOCATE 13,18:PRINT"of four styles..."
  141.  
  142.        SECONDS!=4.0
  143.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  144.  
  145.        CALL MAKEWIND(5,6,11,37,1,9,5,0,0,"Frame Style 1",RETURN.CODE%)
  146.        CALL MAKEWIND(8,9,14,40,2,12,3,0,0,"Frame Style 2",RETURN.CODE%)
  147.        CALL MAKEWIND(11,12,17,43,3,15,4,0,0,"Frame Style 3",RETURN.CODE%)
  148.        CALL MAKEWIND(14,15,20,46,4,0,6,0,0,"Frame Style 4",RETURN.CODE%)
  149.  
  150.        SECONDS!=4.0
  151.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  152.  
  153.        COLOR 7,1
  154.        CLS
  155.        CALL MAKEWIND(9,15,16,65,2,0,7,0,1,"",RETURN.CODE%)
  156.  
  157.        COLOR 0,7
  158.        LOCATE 10,18:PRINT "The frame itself can be in any one of the"
  159.        LOCATE 11,18:PRINT "BASIC foreground colors. It can even blink"
  160.        LOCATE 12,18:PRINT "if you want..."
  161.  
  162.        SECONDS!=5.0
  163.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  164.  
  165.        FOR I=0 TO 15
  166.            CLR%=I
  167.            LABEL$="Color:"+STR$(I)
  168.            CALL MAKEWIND(15,10,23,45,4,CLR%,5,0,0,LABEL$,RETURN.CODE%)
  169.            SECONDS!=.5
  170.            CALL WAITTIME(SECONDS!,RETURN.CODE%)
  171.        NEXT
  172.  
  173.        FOR I=0 TO 15
  174.            CLR%=I+128                            'ADD 128 FOR BLINKING FRAMES
  175.            LABEL$="Color:"+STR$(I+128)
  176.            CALL MAKEWIND(15,10,23,45,4,CLR%,5,0,0,LABEL$,RETURN.CODE%)
  177.            SECONDS!=1.0
  178.            CALL WAITTIME(SECONDS!,RETURN.CODE%)
  179.        NEXT
  180.  
  181.        COLOR 7,1
  182.        CLS
  183.  
  184.        CALL MAKEWIND(9,15,16,65,2,0,7,0,1,"",RETURN.CODE%)
  185.        COLOR 0,7
  186.        LOCATE 14,18:PRINT "The window itself can be presented in many"
  187.        LOCATE 15,18:PRINT "different ways. It can be flat..."
  188.  
  189.        SECONDS!=4.0
  190.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  191.  
  192.        CALL MAKEWIND(2,2,11,32,1,15,4,0,0,"",RETURN.CODE%)
  193.  
  194.        SECONDS!=4.0
  195.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  196.  
  197.        CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
  198.        LOCATE 12,20:print "or it can have a 'true' shadow underneath"
  199.        LOCATE 13,20:print "   giving a three-dimensional effect...  "
  200.  
  201.        SECONDS!=5.0
  202.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  203.  
  204.        CALL MAKEWIND(2,35,11,55,2,15,5,0,1,"",RETURN.CODE%)
  205.  
  206.        SECONDS!=10.0
  207.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  208.  
  209.        COLOR 7,1
  210.        CLS
  211.        COLOR 0,7
  212.  
  213.        CALL MAKEWIND(9,15,16,65,2,0,7,0,1,"",RETURN.CODE%)
  214.        LOCATE 12,18:PRINT "For a particularly dramatic effect, the window"
  215.        LOCATE 13,18:PRINT "can 'grow' onto the screen..."
  216.  
  217.        SECONDS!=3.0
  218.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  219.  
  220.        CALL MAKEWIND(8,10,17,70,2,15,4,1,0,"",RETURN.CODE%)
  221.  
  222.        COLOR 15,1
  223.        LOCATE 12,37
  224.        PRINT "W O W !!!
  225.  
  226.        SECONDS!=3.0
  227.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  228.  
  229.  
  230.        CALL MAKEWIND(9,15,16,65,2,0,7,0,1,"",RETURN.CODE%)
  231.  
  232.        COLOR 0,7
  233.        LOCATE 10,18:PRINT "Once you have your window on the screen, simply"
  234.        LOCATE 11,18:PRINT "use LOCATE, COLOR,  and PRINT statements to put"
  235.        LOCATE 12,18:PRINT "text in them. Another call with the same param-"
  236.        LOCATE 13,18:PRINT "eters as the first ...
  237.  
  238.        SECONDS!=10.0
  239.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  240.  
  241.        CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
  242.  
  243.        LOCATE 10,18:PRINT "will erase the window for new text. But suppose"
  244.        LOCATE 11,18:PRINT "that instead of clearing the window,  you would"
  245.        LOCATE 12,18:PRINT "rather SCROLL the data inside either up or down,"
  246.        LOCATE 13,18:PRINT "and put a new line of text on either the top or"
  247.        LOCATE 14,18:PRINT "bottom line; as the case might be..."
  248.  
  249.        SECONDS!=10.0
  250.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  251.  
  252.        CALL SCROLL(9,15,16,65,1,1,"   NEVER FEAR . . .  ",RETURN.CODE%)
  253.  
  254.        SECONDS!=1.0
  255.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  256.  
  257.        CALL SCROLL(9,15,16,65,1,1,"",RETURN.CODE%)
  258.  
  259.        SECONDS!=1.0
  260.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  261.  
  262.        CALL SCROLL(9,15,16,65,1,1,"   The SCROLL routine will do just that!  You can",RETURN.CODE%)
  263.  
  264.        SECONDS!=1.0
  265.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  266.  
  267.        CALL SCROLL(9,15,16,65,1,1,"   scroll lines of text  -  ",RETURN.CODE%)
  268.  
  269.        SECONDS!=1.0
  270.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  271.  
  272.        CALL SCROLL(9,15,16,65,1,1,"                            UP",RETURN.CODE%)
  273.  
  274.        SECONDS!=1.0
  275.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  276.  
  277.        CALL SCROLL(9,15,16,65,1,1,"                            UP",RETURN.CODE%)
  278.  
  279.        SECONDS!=1.0
  280.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  281.  
  282.        CALL SCROLL(9,15,16,65,1,1,"                            UP",RETURN.CODE%)
  283.  
  284.        SECONDS!=1.0
  285.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  286.  
  287.        CALL SCROLL(9,15,16,65,1,-1,"",RETURN.CODE%)
  288.  
  289.        SECONDS!=1.0
  290.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  291.  
  292.        CALL SCROLL(9,15,16,65,1,-1,"",RETURN.CODE%)
  293.  
  294.        SECONDS!=1.0
  295.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  296.  
  297.        CALL SCROLL(9,15,16,65,1,-1,"",RETURN.CODE%)
  298.  
  299.        SECONDS!=1.0
  300.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  301.  
  302.        CALL SCROLL(9,15,16,65,1,-1,"                      or  DOWN",RETURN.CODE%)
  303.  
  304.        SECONDS!=1.0
  305.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  306.  
  307.        CALL SCROLL(9,15,16,65,1,-1,"                          DOWN",RETURN.CODE%)
  308.  
  309.        SECONDS!=1.0
  310.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  311.  
  312.        CALL SCROLL(9,15,16,65,1,-1,"                          DOWN",RETURN.CODE%)
  313.  
  314.        SECONDS!=2.0
  315.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  316.  
  317.        CALL MAKEWIND(9,15,16,65,2,0,7,1,0,"",RETURN.CODE%)
  318.  
  319.        LOCATE 10,18:PRINT "just as easily as you can create the window!"
  320.        LOCATE 11,18:PRINT "In fact, all of the commands of BASWIND8 are"
  321.        LOCATE 12,18:PRINT "very  easy to use.  Here is a call to create"
  322.        LOCATE 13,18:PRINT "this window ..."
  323.        LOCATE 15,18:PRINT "   CALL MAKEWIND(9,15,16,65,2,0,7,0,1,'')"
  324.  
  325.        SECONDS!=10.0
  326.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  327.  
  328.        CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
  329.  
  330.        LOCATE 11,18:PRINT "And this is the call used to perform the SCROLL"
  331.        LOCATE 12,18:PRINT "operation ..."
  332.        LOCATE 14,18:PRINT "       CALL SCROLL(9,15,16,65,1,1,'')
  333.  
  334.        SECONDS!=5.0
  335.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  336.  
  337. HERE:
  338. '      CLEAR
  339.  
  340.        CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
  341.  
  342.        LOCATE 10,18:PRINT "An even simpler command allows you to save the"
  343.        LOCATE 11,18:PRINT "contents of the screen  into an integer array;"
  344.        LOCATE 12,18:PRINT "so that  you can place a window  on the screen"
  345.        LOCATE 13,18:PRINT "and then quickly remove it; leaving the under-"
  346.        LOCATE 14,18:PRINT "lying  information as it was.  Here is  a good"
  347.        LOCATE 15,18:PRINT "example . . ."
  348.  
  349.        WinActiveScreen=0
  350.        WinScreenSegment%=VARSEG(WinScreenArray%(0))
  351.        SCREEN.POINTER%=2000%*WinActiveScreen
  352.        WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
  353. '
  354. ' The screen save areas MUST be defines as DYNAMIC array, therefore the
  355. 'segment address and offset of memory block MUST be passed to .asm routines
  356. '
  357.        CALL SAVESCRN(WinWaitForVerticalRetrace,_
  358.                      WinScreenSegment%,_
  359.                      WinScreenPointer%,RETURN.CODE%)
  360.  
  361.        SECONDS!=10.0
  362.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  363.  
  364.        CALL MAKEWIND(4,4,13,42,4,0,2,0,1,"",RETURN.CODE%)
  365.        LOCATE 9,10
  366.        COLOR 0,2
  367.        PRINT "This is the first level ..."
  368.  
  369.        SECONDS!=3.0
  370.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  371.  
  372.        WinActiveScreen=1
  373.        WinScreenSegment%=VARSEG(WinScreenArray%(0))
  374.        SCREEN.POINTER%=2000%*WinActiveScreen
  375.        WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
  376.        CALL SAVESCRN(WinWaitForVerticalRetrace,_
  377.                      WinScreenSegment%,_
  378.                      WinScreenPointer%,RETURN.CODE%)
  379.  
  380.        CALL MAKEWIND(7,30,18,79,4,15,4,0,1,"",RETURN.CODE%)
  381.  
  382.        LOCATE 12,40
  383.        COLOR 15,4
  384.        PRINT "This is the second level ..."
  385.  
  386.        SECONDS!=3.0
  387.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  388.  
  389.        WinActiveScreen=2
  390.        WinScreenSegment%=VARSEG(WinScreenArray%(0))
  391.        SCREEN.POINTER%=2000%*WinActiveScreen
  392.        WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
  393.        CALL SAVESCRN(WinWaitForVerticalRetrace,_
  394.                      WinScreenSegment%,_
  395.                      WinScreenPointer%,RETURN.CODE%)
  396.  
  397.        CALL  MAKEWIND(10,25,22,55,4,12,3,0,1,"",RETURN.CODE%)
  398.  
  399.        LOCATE 16,27
  400.        COLOR 12,0
  401.        PRINT "This is the third level ..."
  402.  
  403.        SECONDS!=3.0
  404.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  405.  
  406.        LOCATE 16,27
  407.        PRINT "Now to go back ...           "
  408.  
  409.        SECONDS!=2.0
  410.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  411.  
  412.        WinActiveScreen=2
  413.        WinScreenSegment%=VARSEG(WinScreenArray%(0))
  414.        SCREEN.POINTER%=2000%*WinActiveScreen
  415.        WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
  416. '
  417. ' The screen save areas MUST be defines as DYNAMIC array, therefore the
  418. 'segment address and offset of memory block MUST be passed to .asm routines
  419. '
  420.        CALL RESTSCRN(WinWaitForVerticalRetrace,_
  421.                      WinScreenSegment%,_
  422.                      WinScreenPointer%,RETURN.CODE%)
  423.  
  424.        SECONDS!=1.0
  425.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  426.  
  427.        WinActiveScreen=1
  428.        WinScreenSegment%=VARSEG(WinScreenArray%(0))
  429.        SCREEN.POINTER%=2000%*WinActiveScreen
  430.        WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
  431.        CALL RESTSCRN(WinWaitForVerticalRetrace,_
  432.                      WinScreenSegment%,_
  433.                      WinScreenPointer%,RETURN.CODE%)
  434.  
  435.  
  436.        SECONDS!=1.0
  437.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  438.  
  439.        WinActiveScreen=0
  440.        WinScreenSegment%=VARSEG(WinScreenArray%(0))
  441.        SCREEN.POINTER%=2000%*WinActiveScreen
  442.        WinScreenPointer%=VARPTR(WinScreenArray%(SCREEN.POINTER%))
  443.        CALL RESTSCRN(WinWaitForVerticalRetrace,_
  444.                      WinScreenSegment%,_
  445.                      WinScreenPointer%,RETURN.CODE%)
  446.  
  447.        SECONDS!=3.0
  448.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  449.  
  450.        CALL MAKEWIND(9,15,16,65,2,0,7,0,0,"",RETURN.CODE%)
  451.  
  452.  
  453.        COLOR 0,7
  454.        LOCATE  9,18:PRINT "The basic routines in the  BASWIND8  package"
  455.        LOCATE 10,18:PRINT "give you all you  need to create some power-"
  456.        LOCATE 11,18:PRINT "ful 'toolbox' modules to integrate into your"
  457.        LOCATE 12,18:PRINT "programs and NOW with MS Mouse support also."
  458.        LOCATE 14,18:PRINT "  To see what more awaits you, just run the  "
  459.        LOCATE 15,18:PRINT " DEMO2 program, and have your mouse ready !! "
  460.  
  461.        SECONDS!=12.0
  462.        CALL WAITTIME(SECONDS!,RETURN.CODE%)
  463.  
  464.        LOCATE 25,1
  465.  
  466. '      END
  467. '==============================================================================
  468.